//
//  UIView+KeyPathView.m
//  DoubleJinGe
//
//  Created by 喻贵华 on 16/7/1.
//  Copyright © 2016年 Rex. All rights reserved.
//

#import "UIView+KeyPathView.h"



@implementation UIView (KeyPathView)

@dynamic borderColor;
@dynamic borderWidth;
@dynamic cornerRadius;

- (void)setBorderWidth:(CGFloat)borderWidth

{
    
    if(borderWidth <0)return;
    
    self.layer.borderWidth = borderWidth;
    
}



/**
 
 * 设置边框颜色
 
 */

- (void)setBorderColor:(UIColor *)borderColor

{
    
    self.layer.borderColor = borderColor.CGColor;
    
}



/**
 
 *  设置圆角
 
 */

- (void)setCornerRadius:(CGFloat)cornerRadius

{
    
    self.layer.cornerRadius = cornerRadius;
    
    self.layer.masksToBounds = cornerRadius >0;
    
}
@end
